package cn.tedu.system.base.response;

import lombok.Getter;

@Getter
public enum StatusCode {
    SUCCESS(2000, "操作成功"),
    FAILED(5000, "操作失败"),
    VALIDATE_FAILED(4000, "参数检验失败"),
    UNAUTHORIZED(4001, "暂未登录或token已经过期"),
    FORBIDDEN(4003, "没有相关权限"),
    NOT_FOUND(4004, "资源不存在"),

    // 用户相关
    USER_NOT_EXIST(1001, "用户不存在"),
    USER_DISABLED(1002, "用户已被禁用"),
    USERNAME_EXIST(1003, "用户名已存在"),
    EMAIL_EXIST(1004, "邮箱已存在"),
    PHONE_EXIST(1005, "手机号已存在"),
    LOGIN_FAILED(1006, "用户名或密码错误"),
    USER_NOT_EXIST_OR_ERROR(1007,"用户不存在或出错"),
    USER_INFORMATION_NOT_MATCH(1008,"用户信息不匹配"),

    // 商品相关
    PRODUCT_NOT_EXIST(2001, "商品不存在"),
    PRODUCT_OFF_SHELF(2002, "商品已下架"),
    PRODUCT_STOCK_NOT_ENOUGH(2003, "商品库存不足"),
    PRODUCT_STATUS_ERROR(2004, "商品状态异常"),
    PRODUCT_MERCHANT_MISMATCH(2005, "商品与商家不匹配"),
    PRODUCT_QUANTITY_ABNORMAL(2006,"商品数量必须大于0"),
    PRODUCT_PRICE_ABNORMAL(2007,"商品价格异常"),
    PRODUCT_STOCK_ABNORMAL(2008,"商品修改异常"),


    // 订单相关
    ORDER_NOT_EXIST(3001, "订单不存在"),
    ORDER_STATUS_ERROR(3002, "订单状态异常"),
    ORDER_CANCEL_FAILED(3003, "订单取消失败"),

    // 商家相关
    MERCHANT_NOT_EXIST(5001, "商家不存在"),
    MERCHANT_NOT_APPROVED(5002, "商家未通过审核"),
    MERCHANT_ALREADY_EXISTS(5003, "用户已注册商家"),

    // 评价相关
    REVIEW_NOT_EXIST(6001, "评价不存在"),
    ORDER_EXIST(6002,"已评价过"),
    REVIEW_MERCHANT_MISMATCH(6003, "评价与商家不匹配"),

    // 支付相关
    PAYMENT_FAILED(7001, "支付失败"),
    PAYMENT_AMOUNT_ERROR(7002, "支付金额不正确"),
    ERROR(7003, "id不能为空");

    private int code;
    private String message;

    StatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
}